Repository navigation
docs: ATOMesh multimodal image requests and E/P/D disaggregation design - #3417
junyyang-amd wants to merge 44 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🏷️ CI GuideRuns automatically on every eligible PR before approval:
Heavy model tests:
Path scope:
|
| fold the multimodal generator into `generate_async`, a larger change to the | ||
| text path project principle 2 keeps still. | ||
|
|
||
| **D5. Decode takes the pretokenized branch.** In `_chat_completions`, a |
There was a problem hiding this comment.
is_multimodal comes from the body, not multimodal_data.. so D5 as written still calls generate_async_multimodal with None. clear is_multimodal or gate on multimodal_data?
| - `atom/model_engine/scheduler.py`: `preempt` fails an image decode | ||
| sequence that holds no media (D6). | ||
| - `atom/config.py`, `atom/model_engine/arg_utils.py`: `encoder_only` (D10). | ||
| - `atom/utils/envs.py`: `ATOM_EC_LEASE_S` (D12). |
There was a problem hiding this comment.
ATOM_EC_LEASE_S should also be added to docs/environment_variables.md, other ATOM_* are there
There was a problem hiding this comment.
Done in #3411: ATOM_EC_LEASE_S is in docs/environment_variables.md.
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Action required before merge (5)
- Land this doc with the code it describes, not ahead of it. About half of it (E/P/D: D9-D17,
ec_transfer_params,WorkerType::Encode,--encoder-only,ATOM_EC_LEASE_S) has no implementation in any open PR. The rest is written in present tense but exists only in unmerged #3407 (with_media_digests,policy_apply.rsdecision event,can_chunk_requestmedia check), #3410 (kv params throughgenerate_async_multimodal, D-sidecache_seed, preempt fail-fast) and #3414 (harness,build_kimi_k3_inputscache_seed). Either trim it to what #3407/#3410/#3414 ship and merge it after them, or mark each decision Implemented (PR #) / Proposed. Move the E/P/D proposal to an issue until code exists. - Make it readable outside your fork.
docs/atomesh_multimodal_epd.mdcitesjunyyang-amd/ATOM#N35 times, sometimes as a decision's only basis (D8, D11, D14). It also cites "project principle 1-5", which no file defines, plus afork/EPD 3c5f13508checkout,g15, "owner-named node", "spike" and "umbrella". Inline the measured numbers and the rule each decision rests on, or link ROCm/ATOM issues. - Make the Acceptance table match the harness. In #3414's
tests/accept/atomesh_mm/onlym31 single mmstar|mmmu-pro|distinct(plus thedirecttopology) exist. There is notopologies/pd.shorepd.sh, nomodels/k31.env, nochecks/ttft.pyorci_case.py, and no image cell inmodels_atomesh.yaml, so A3(k31) and A4-A8 cannot run as written. Mark these commands as planned, or drop them. - Fix the D4/D5 wording to match #3410. Line 234 says decode "takes the pretokenized branch before the
is_multimodalcheck". #3410 instead clearsis_multimodalwhendo_remote_prefilland the ids are present (api_server.py:2224), which is valar-cop's point. Line 219: the n>1 chat branch already passeskv_transfer_paramson main (generate_async_fanout,api_server.py:2345). Only the single-image branches change. - Remove the CLAUDE.md row, or mark it as a design. Every other row in that table points to a guide for a shipped feature. As written, this row tells agents that E/P/D exists.
Minor (details in review notes): D13 prefill_media_payload also drops image_grid_thw once leased. D12 should say E bumps the generation word before it overwrites the payload, and how P's TP ranks agree when only some of them fall back to the local tower. Mixed embeddings would diverge across ranks. D11 should say why the existing ATOM_MOONCAKE_MATCHED_RAILS mode (docs/mooncake_matched_rails.md) does not apply, since that doc warns that a multi-HCA engine can pick a disconnected rail. The changes-per-file list should add docs/environment_variables.md for ATOM_EC_LEASE_S (valar-cop). The PR description's "CPU unit suite" result says nothing about a docs-only change.
Reviewed at 3cf746b. Docs-only; checks green (heavy CI skipped as expected), RTD build passes.
|
ci triage for 3cf746b:
|
valar-cop
left a comment
There was a problem hiding this comment.
some changes needed..
atomesh_multimodal_epd.md:234 — D5 mechanism is off: is_multimodal is cleared when leaves_media_on_prefill (do_remote_prefill + cache_seed), not pretokenized before the check. also n>1 in D4 already on main..
atomesh_multimodal_epd.md:3 — can't read this outside your fork: fork-only issue links, undefined principles and terms (g15, spike, umbrella). inline the numbers and cite ROCm/ATOM instead?
ci green.
| router and hash bytes, which adds image decoding to the Rust hot path for a | ||
| hit rate no acceptance item asks for. | ||
|
|
||
| **D3. Decision observability is one `debug` tracing event per selection.** |
There was a problem hiding this comment.
D3 says shipped but nothing emits the routing decision line with key_hash that checks/distinct.py parses.. mark it proposed or land the event?
| fold the multimodal generator into `generate_async`, a larger change to the | ||
| text path project principle 2 keeps still. | ||
|
|
||
| **D5. Decode takes the pretokenized branch.** In `_chat_completions`, a |
There was a problem hiding this comment.
[verified] D5 misstates the mechanism: the decode does not take pretokenized 'before the is_multimodal check'; api_server.py:2282 computes is_multimodal and clears it when leaves_media_on_prefill (sequence.py:192: do_remote_prefill + cache_seed, not prompt_token_ids, as the gate). D4 (line 219) also lists n>1 as newly passing kv_transfer_params, but generate_async_fanout already had it on main. Rewrite D5 to describe the is_multimodal clearing and the do_remote_prefill+cache_seed predicate, and scope D4's change list to the single-image branches.
There was a problem hiding this comment.
Fixed in 6597890: the decode decision now names the leaves_media_on_prefill clearing, and the generator decision lists only the single-request branch.
| @@ -0,0 +1,562 @@ | |||
| # ATOMesh multimodal image requests and E/P/D disaggregation | |||
|
|
|||
| Design for junyyang-amd/ATOM#2: image chat requests through ATOMesh for | |||
There was a problem hiding this comment.
[verified] Unreadable outside the author's fork: 35 junyyang-amd/ATOM#N links and zero ROCm/ATOM ones, 5 'project principle 1-5' citations no file defines, a fork/EPD 3c5f13508 checkout, and undefined g15 / owner-named node / spike / umbrella; D8, D11 and D14 rest only on these. Maintainer item 2, still open. Inline the measured numbers and the rule behind each principle, define or link the terminology, and cite ROCm/ATOM issues or inline the spike evidence.
There was a problem hiding this comment.
Fixed in 6597890: no fork reference remains. The measurements and rules are inline, and the nodes are defined.
Brings h1's route-log distinction check here. distinct.py keeps h3's three requests and prefix-cache comparison, and reads the routing keys off the `mesh::route` "Selected worker" event: media_count 1 on each, blue match_ratio below 1, the second red one 1. epd.sh counts image requests on the same event (`pool="prefill"`, `media_count` >= 1) with the route log on, instead of the `routing decision ... media_digests` event the router no longer emits. k31.env takes the same newer image as m31.env. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Addresses the review of #3417: - Each decision names the PR of the stack that implements it (#3410, #3407, #3411-#3413, #3408, #3409, #3414-#3416); the Acceptance table names the PR that adds each check. - No reference outside ROCm/ATOM remains: the requirement, the measurements and the rules decisions rest on are stated in place. - D4/D5 follow #3410: decode clears `is_multimodal` when P kept the media; only the non-streaming single branch returns `cache_seed`. - D6 names the scheduler's actual refusal of a media-less local prefill. - D3 and A3 describe the route-log `match_ratio` check. - D11 says why matched rails do not apply; D12 states E's word handling as implemented, the 503 on a full pool, and the open gap: P's TP ranks do not agree on a read of E's embeddings. D13 notes `image_grid_thw` is dropped with the pixels once leased. - Harness facts follow #3416's defaults (g07, g08, g24 and HCA maps). - The CLAUDE.md row marks the guide as the design of its PR stack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Round 2 pushed 6597890. All 5 points addressed; point 1 differently.
Minor points done. The TP mixing was a real bug: fixed in #3412 @ dd0cf0e. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
valar-cop
left a comment
There was a problem hiding this comment.
one wrong claim in D19/A8, rest looks fine..
ci green.
| **D19. The CI case is an M3.1 aggregated cell in `models_atomesh.yaml`.** | ||
| *#3415; #3413 serves images through the ATOMesh standalone service.* | ||
| - The cell `minimax-m31-flash-mxfp4-agg-tp4-mmmu` serves the recipe's | ||
| aggregated TP4 server through ATOMesh's standalone service |
There was a problem hiding this comment.
the in-tree cell never sets USE_ATOMESH_ENTRYPOINTS, so it runs plain ATOM today.. either set it in the cell env or mark D19/A8 as planned?
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… follow-up - D11: E->P goes through atom/ec_transfer (EcWriter.put / EcReader.get, a handle naming its transport); Mooncake is one backend and shares HCA selection with the KV connector through atom/utils/mooncake_hca.py. Records the follow-up of fetching at scheduling time, which would make a non-RDMA backend viable. - D12: renamed classes; a generation of 0, a malformed handle and a reader that cannot start all fall back to the tower. - D13: the handle's shape; P takes it only with --accept-ec-transfer-params. - Changes per PR: new files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Needs owner ruling: three design questions for this doc, from reviewing #3411 and #3412.
Context
|
D12 follows #3411's round 4: each entry's generation, address and length sit in a slot table apart from the rows; P syncs before the NIC writes and compares all three; every None is logged and counted by reason. Records reclaiming on a P ack in the slot's reserved field as the follow-up, and the D13 handle gains the slot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Unconfigured, mooncake_hca now picks the HCA on the GPU's own PCIe switch from its PCI address, whatever the HCAs are named. D11 says so; the acceptance runs' naming of HCAs (and g15's missing rdma<N>) becomes the history of D8's runs, and matched rails is out for the one reason left: it covers only the KV connector's writes, not E's pool. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
D11: the EC backend and its helpers import nothing from kv_transfer; the PCI topology is atom/utils/pci_topology.py. D12: one slot per 64 KiB of the whole-GiB region, carved from its front, so space runs out before slots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ready for review. No blocking issues. PR 8 of 8 in stack #3768: it merges after #3415, with the code it describes.
Why
A reviewer of the E/P/D stack had no written design to check it against. For example, #3409 sends an image request to prefill without embeddings when the encoder fails, and nothing in the repository said why that beats failing the request.
What changed
docs/atomesh_multimodal_epd.mdwalks each request flow as a diagram: single instance, image distinction, 1P1D, E/P/D, E/P/D when E cannot serve, Kimi-K3.1 and the CI case.CLAUDE.mdlinks it from the Detailed Guides table as the design of this stack.Review focus
Testing
A documentation change. Code facts were checked against
mainat fe9b2f0 and the stack's heads on 2026-11-27.Follow-ups